package org.yes.util.helper;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * User: mtymes
 * Date: May 27, 2010
 * Time: 3:05:05 AM
 */
public class Notifiers {

    private List<Method> beforeTableProcessedMethods = new ArrayList<Method>();
    private List<Method> afterTableProcessedMethods = new ArrayList<Method>();
    private List<Method> afterNoTableFoundMethods = new ArrayList<Method>();
    private List<Method> beforeHeaderProcessedMethods = new ArrayList<Method>();
    private List<Method> afterHeaderProcessedMethods = new ArrayList<Method>();
    private List<Method> beforeRowProcessedMethods = new ArrayList<Method>();
    private List<Method> afterRowProcessedMethods = new ArrayList<Method>();


    public void addMethodToCallBeforeTableProcessed(Method method) {
        beforeTableProcessedMethods.add(method);
    }


    public Iterator<Method> getMethodToCallBeforeTableProcessedIterator() {
        return beforeTableProcessedMethods.iterator();
    }


    public void addMethodToCallAfterTableProcessed(Method method) {
        afterTableProcessedMethods.add(method);
    }


    public Iterator<Method> getMethodToCallAfterTableProcessedIterator() {
        return afterTableProcessedMethods.iterator();
    }


    public void addMethodToCallAfterNoTableFound(Method method) {
        afterNoTableFoundMethods.add(method);
    }


    public Iterator<Method> getMethodToCallAfterNoTableFoundIterator() {
        return afterNoTableFoundMethods.iterator();
    }


    public void addMethodToCallBeforeHeaderProcessed(Method method) {
        beforeHeaderProcessedMethods.add(method);
    }


    public Iterator<Method> getMethodToCallBeforeHeaderProcessedIterator() {
        return beforeHeaderProcessedMethods.iterator();
    }


    public void addMethodToCallAfterHeaderProcessed(Method method) {
        afterHeaderProcessedMethods.add(method);
    }


    public Iterator<Method> getMethodToCallAfterHeaderProcessedIterator() {
        return afterHeaderProcessedMethods.iterator();
    }


    public void addMethodToCallBeforeRowProcessed(Method method) {
        beforeRowProcessedMethods.add(method);
    }


    public Iterator<Method> getMethodToCallBeforeRowProcessedIterator() {
        return beforeRowProcessedMethods.iterator();
    }


    public void addMethodToCallAfterRowProcessed(Method method) {
        afterRowProcessedMethods.add(method);
    }


    public Iterator<Method> getMethodToCallAfterRowProcessedIterator() {
        return afterRowProcessedMethods.iterator();
    }
}
